home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 1 / BBS in a box - Trilogy I.iso / Files / QuickTime / QT Tools / QuickTime Interfacing / ImageCompression.p < prev    next >
Encoding:
Text File  |  1992-10-20  |  26.8 KB  |  606 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Tuesday, August 13, 1991 at 4:31 PM
  4.  ImageCompression.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.  Copyright Apple Computer, Inc. 1991
  8.  All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT ImageCompression;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingImageCompression}
  22. {$SETC UsingImageCompression := 1}
  23.  
  24. {$I+}
  25. {$SETC ImageCompressionIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingQuickDraw}
  28. {$I $$Shell(PInterfaces)QuickDraw.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingQDOffscreen}
  31. {$I $$Shell(PInterfaces)QDOffscreen.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingTypes}
  34. {$I $$Shell(PInterfaces)Types.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingComponents}
  37. {$I $$Shell(PInterfaces)Components.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED UsingStandardFile}
  40. {$I $$Shell(PInterfaces)StandardFile.p}
  41. {$ENDC}
  42. {$SETC UsingIncludes := ImageCompressionIncludes}
  43.  
  44. CONST
  45. gestaltCompressionMgr = 'icmp';
  46.  
  47. { These are the bits that are set in the Component flags, and also in the codecInfo struct. }
  48.  
  49. codecInfoDoes1 = $1;                    { codec can work with 1-bit pixels }
  50. codecInfoDoes2 = $2;                    { codec can work with 2-bit pixels }
  51. codecInfoDoes4 = $4;                    { codec can work with 4-bit pixels }
  52. codecInfoDoes8 = $8;                    { codec can work with 8-bit pixels }
  53. codecInfoDoes16 = $10;                    { codec can work with 16-bit pixels }
  54. codecInfoDoes32 = $20;                    { codec can work with 32-bit pixels }
  55. codecInfoDoesDither = $40;                { codec can do ditherMode }
  56. codecInfoDoesStretch = $80;                { codec can stretch to arbitrary sizes }
  57. codecInfoDoesShrink = $100;                { codec can shrink to arbitrary sizes }
  58. codecInfoDoesMask = $200;                { codec can mask to clipping regions }
  59.  
  60. codecInfoDoesTemporal = $400;            { codec can handle temporal redundancy }
  61.  
  62. codecInfoDoesDouble = $800;                { codec can stretch to double size exactly }
  63. codecInfoDoesQuad = $1000;                { codec can stretch to quadruple size exactly }
  64. codecInfoDoesHalf = $2000;                { codec can shrink to half size }
  65. codecInfoDoesQuarter = $4000;            { codec can shrink to quarter size }
  66.  
  67. codecInfoDoesRotate = $8000;            { codec can rotate on decompress }
  68. codecInfoDoesHorizFlip = $10000;        { codec can flip horizontally on decompress }
  69. codecInfoDoesVertFlip = $20000;            { codec can flip vertically on decompress }
  70. codecInfoDoesSkew = $40000;                { codec can skew on decompress }
  71. codecInfoDoesBlend = $80000;            { codec can blend on decompress }
  72. codecInfoDoesWarp = $100000;            { codec can warp arbitrarily on decompress }
  73. codecInfoDoesRecompress = $200000;        { codec can recompress image without accumulating errors }
  74. codecInfoDoesSpool = $400000;            { codec can spool image data }
  75.  
  76. codecInfoDepth1 = $1;                    { compressed data at 1 bpp depth available }
  77. codecInfoDepth2 = $2;                    { compressed data at 2 bpp depth available }
  78. codecInfoDepth4 = $4;                    { compressed data at 4 bpp depth available }
  79. codecInfoDepth8 = $8;                    { compressed data at 8 bpp depth available }
  80. codecInfoDepth16 = $10;                    { compressed data at 16 bpp depth available }
  81. codecInfoDepth32 = $20;                    { compressed data at 32 bpp depth available }
  82. codecInfoDepth24 = $40;                    { compressed data at 24 bpp depth available }
  83. codecInfoDepth33 = $80;                    { compressed data at 1 bpp monochrome depth  available }
  84. codecInfoDepth34 = $100;                { compressed data at 2 bpp grayscale depth available }
  85. codecInfoDepth36 = $200;                { compressed data at 4 bpp grayscale depth available }
  86. codecInfoDepth40 = $400;                { compressed data at 8 bpp grayscale depth available }
  87. codecInfoStoresClut = $800;                { compressed data can have custom cluts }
  88. codecInfoDoesLossless = $1000;            { compressed data can be stored in lossless format }
  89.  
  90. codecFlagUseImageBuffer = $1;            { (input) allocate buffer for whole image on decompress sequence }
  91. codecFlagUseScreenBuffer = $2;            { (input) allocate buffer for screen on decompress sequence for faster updates }
  92. codecFlagUpdatePrevious = $4;            { (input) udate previous buffer on compress sequence }
  93. codecFlagNoScreenUpdate = $8;            { (input) dont update screen, but do update image buffer if allocated }
  94. codecFlagWasCompressed = $10;            { (input) hint to compressor that image was previously compressed }
  95. codecFlagDontOffscreen = $20;            { (input) return error instead of automatically going offscreen }
  96. codecFlagUpdatePreviousComp = $40;        { (input) udate previous buffer on compress sequence }
  97. codecFlagForceKeyFrame = $80;            { (input) when sent to CompressSequenceFrame, forces that frame to be a key frame }
  98. codecFlagOnlyScreenUpdate = $100;        { (input) only update screen from }
  99. codecFlagLiveGrab    = $200;                { (input) data being compressed is from live source (speed is critical) }
  100. codecFlagDontUseNewImageBuffer = $400;     { (input) return error if image buffer is new or reallocated }
  101. codecFlagInterlaceUpdate = $800;        { (input) use interlaced update }
  102.  
  103.  
  104. codecFlagUsedNewImageBuffer    = $4000;    { (output) indicates that image buffer was first used on this decompress sequence }
  105. codecFlagUsedImageBuffer = $8000;        { (output) indicates that image buffer was used on this decompress sequence }
  106.  
  107. codecErr = -8960;                        { the codec returned an error }
  108. noCodecErr = -8961;                        { the specified codec could not be found }
  109. codecUnimpErr = -8962;                    { this feature is not implemented by the specified codec }
  110. codecSizeErr = -8963;
  111. codecScreenBufErr = -8964;                { the screen buffer could not be allocated }
  112. codecImageBufErr = -8965;                { the image buffer could not be allocated }
  113. codecSpoolErr = -8966;                    { the compressed data must be in memory (spooling did not work) }
  114. codecAbortErr = -8967;                    { the operation was aborted by the progress proc }
  115. codecWouldOffscreenErr = -8968;            { an offscreen access would have been used, but wasn't allowed because codecFlagDontOffscreen was set }
  116. codecBadDataErr = -8969;                { compressed data was found to have inconsistencies }
  117. codecDataVersErr = -8970;                { compressed data was of a format version that codec couldn't handle }
  118. codecConditionErr = -8972;                { codec can not do requested operation }
  119. codecOpenErr = -8973;                    { the codec  could not be opened }
  120.  
  121. codecMinimumDataSize = 32768;            { The minimum data size for spooling in or out data }
  122.  
  123. compressorComponentType = 'imco';        { the type for "Components" which compress images }
  124. decompressorComponentType = 'imdc';        { the type for "Components" which decompress images }
  125.  
  126. TYPE
  127. CompressorComponent = Component;        { a Component which compresses images }
  128. DecompressorComponent = Component;        { a Component which decompresses images }
  129. CodecComponent = Component;                { a Component which decompresses or compresses images }
  130.  
  131. CodecType = OSTYPE;                    { type descriptor for codecs i.e: 'appl','jpeg','rle ' }
  132.  
  133. CodecFlags = INTEGER;                    { flags for codec manager calls }
  134.  
  135. CodecQ = LONGINT;
  136. DataProcPtr = ProcPtr;
  137. FlushProcPtr = ProcPtr;
  138.  
  139. CONST
  140. defaultDither    = 0;
  141. forceDither        = 1;
  142. suppressDither    = 2;
  143.  
  144. codecLosslessQuality    = $400;
  145. codecMaxQuality            = $3FF;
  146. codecMinQuality            = $000;
  147. codecLowQuality            = $100;
  148. codecNormalQuality        = $200;
  149. codecHighQuality        = $300;
  150.  
  151. anyCodec                 =  0;            { take first working codec of given type }
  152. bestSpeedCodec             = -1;            { take fastest codec of given type }
  153. bestFidelityCodec        = -2;            { take codec which is most accurate}
  154. bestCompressionCodec    = -3;            { take codec of given type that is most accurate }
  155.  
  156. codecCompletionSource = 1;                { asynchronous codec is done with source data  }
  157. codecCompletionDest = 2;                { asynchronous codec is done with destination data  }
  158.  
  159. TYPE
  160. CompletionProcPtr = ProcPtr;
  161.  
  162. CONST
  163. codecProgressOpen = 0;
  164. codecProgressUpdatePercent = 1;
  165. codecProgressClose = 2;
  166.  
  167. TYPE
  168. ProgressProcPtr = ProcPtr;
  169.  
  170. ImageSequence = LONGINT;
  171.  
  172. ProgressProcRecordPtr = ^ProgressProcRecord;
  173. ProgressProcRecord = RECORD
  174.  progressProc: ProgressProcPtr;
  175.  progressRefCon: LONGINT;
  176.  END;
  177.  
  178. CompletionProcRecordPtr = ^CompletionProcRecord;
  179. CompletionProcRecord = RECORD
  180.  completionProc: CompletionProcPtr;
  181.  completionRefCon: LONGINT;
  182.  END;
  183.  
  184. DataProcRecordPtr = ^DataProcRecord;
  185. DataProcRecord = RECORD
  186.  dataProc: DataProcPtr;
  187.  dataRefCon: LONGINT;
  188.  END;
  189.  
  190. FlushProcRecordPtr = ^FlushProcRecord;
  191. FlushProcRecord = RECORD
  192.  flushProc: FlushProcPtr;
  193.  flushRefCon: LONGINT;
  194.  END;
  195.  
  196.  
  197. AlignmentProcPtr = ProcPtr;
  198.  
  199. AlignmentProcRecordPtr = ^AlignmentProcRecord;
  200. AlignmentProcRecord = RECORD
  201.     alignmentProc: AlignmentProcPtr;
  202.     alignmentRefCon: LONGINT;
  203.  END;
  204.  
  205. DataRateParamsPtr = ^DataRateParams;
  206. DataRateParams = RECORD
  207.     dataRate: LONGINT;
  208.     dataOverrun: LONGINT;
  209.     frameDuration: LONGINT;
  210.     keyFrameRate: LONGINT;
  211.     minSpatialQuality: CodecQ;
  212.     minTemporalQuality: CodecQ;
  213.  END;
  214.  
  215.  
  216.     The ImageDescription is private data which is produced when an image or sequence 
  217.     is compressed. It fully describes the format of the compressed data.}
  218.  
  219. ImageDescriptionPtr = ^ImageDescription;
  220. ImageDescriptionHandle = ^ImageDescriptionPtr;
  221. ImageDescription = PACKED RECORD
  222.  idSize: LONGINT;                        { total size of ImageDescription including extra data ( CLUTs and other per sequence data }
  223.  cType: CodecType;                        { what kind of codec compressed this data }
  224.  resvd1: LONGINT;                        { reserved for apple use }
  225.  resvd2: INTEGER;                        { reserved for apple use }
  226.  dataRefIndex: INTEGER;                    { set to zero }
  227.  version: INTEGER;                        { which version is this data }
  228.  revisionLevel: INTEGER;                { what version of that codec did this }
  229.  vendor: LONGINT;                        { whose  codec compressed this data }
  230.  temporalQuality: CodecQ;                { what was the temporal quality factor          }
  231.  spatialQuality: CodecQ;                { what was the spatial quality factor          }
  232.  width: INTEGER;                        { how many pixels wide is this data }
  233.  height: INTEGER;                        { how many pixels high is this data }
  234.  hRes: Fixed;                            { horizontal resolution }
  235.  vRes: Fixed;                            { vertical resolution }
  236.  dataSize: LONGINT;                        { if known, the size of data for this image descriptor }
  237.  frameCount: INTEGER;                    { number of frames this description applies to }
  238.  name: PACKED ARRAY [0..31] OF CHAR;    { name of codec ( in case not installed ) }
  239.  depth: INTEGER;                        { what depth is this data (1-32) or ( 33-40 grayscale ) }
  240.  clutID: INTEGER;                        { clut id or if 0 clut follows  or -1 if no clut }
  241.  END;
  242.  
  243.     The CodecInfo is the information returned as the codecInfo struct by a codec Component
  244.     to the codec manager or to the caller. It is specific to the particular codec
  245.     implementation and not to the codec type.}
  246.  
  247. CodecInfo = PACKED RECORD
  248.  typeName: PACKED ARRAY [0..31] OF CHAR;{ name of the codec type i.e.: 'Apple Image Compression' }
  249.  version: INTEGER;                        { version of the codec data that this codec knows about }
  250.  revisionLevel: INTEGER;                { revision level of this codec i.e: 0x00010001 (1.0.1) }
  251.  vendor: LONGINT;                        { Maker of this codec i.e: 'appl' }
  252.  decompressFlags: LONGINT;                { codecInfo flags for decompression capabilities }
  253.  compressFlags: LONGINT;                { codecInfo flags for compression capabilities }
  254.  formatFlags: LONGINT;                    { codecInfo flags for compression format details }
  255.  compressionAccuracy: CHAR;                { measure (1-255) of accuracy of this codec for compress (0 if unknown) }
  256.  decompressionAccuracy: CHAR;            { measure (1-255) of accuracy of this codec for decompress (0 if unknown) }
  257.  compressionSpeed: INTEGER;                { ( millisecs for compressing 320x240 on base mac II) (0 if unknown) }
  258.  decompressionSpeed: INTEGER;            { ( millisecs for decompressing 320x240 on mac II)(0 if unknown) }
  259.  compressionLevel: CHAR;                { measure (1-255) of compression level of this codec (0 if unknown) }
  260.  resvd: CHAR;                            { pad }
  261.  minimumHeight: INTEGER;                { minimum height of image (block size) }
  262.  minimumWidth: INTEGER;                    { minimum width of image (block size) }
  263.  decompressPipelineLatency: INTEGER;    { in milliseconds ( for asynchronous codecs ) }
  264.  compressPipelineLatency: INTEGER;        { in milliseconds ( for asynchronous codecs ) }
  265.  privateData: LONGINT;
  266.  END;
  267.  
  268. { Name list returned by GetCodecNameList. }
  269. CodecNameSpec = PACKED RECORD
  270.  codec: CodecComponent;
  271.  cType: CodecType;
  272.  typeName: PACKED ARRAY [0..31] OF CHAR;
  273.  name: Handle;
  274.  END;
  275.  
  276. CodecNameSpecListPtr = ^CodecNameSpecList;
  277. CodecNameSpecList = RECORD
  278.  count: INTEGER;
  279.  list: ARRAY [0..0] OF CodecNameSpec;
  280.  END;
  281.  
  282. {  Matrix stuff  }
  283. MatrixRecordPtr = ^MatrixRecord;
  284. MatrixRecord = RECORD
  285.  matrix: ARRAY [0..2,0..2] OF Fixed;
  286.  END;
  287.  
  288. FixedPoint = RECORD
  289.  x: Fixed;
  290.  y: Fixed;
  291.  END;
  292.  
  293. FixedRect = RECORD
  294.  left: Fixed;
  295.  top: Fixed;
  296.  right: Fixed;
  297.  bottom: Fixed;
  298.  END;
  299.  
  300.  
  301. FUNCTION CodecManagerVersion(VAR version: LONGINT): OSErr;
  302.  INLINE $7000+$0000,$AAA3;
  303. FUNCTION GetCodecNameList(VAR list: CodecNameSpecListPtr;showAll: INTEGER): OSErr;
  304.  INLINE $7000+$0001,$AAA3;
  305. FUNCTION DisposeCodecNameList(list: CodecNameSpecListPtr): OSErr;
  306. INLINE  $7000+$000f,$AAA3;
  307. FUNCTION GetCodecInfo(VAR info: CodecInfo;cType: CodecType;codec: CodecComponent): OSErr;
  308.  INLINE $7000+$0003,$AAA3;
  309. FUNCTION GetMaxCompressionSize(src: PixMapHandle;srcRect: Rect;colorDepth: INTEGER;
  310.  quality: CodecQ;cType: CodecType;codec: CompressorComponent;VAR size: LONGINT): OSErr;
  311.  INLINE $7000+$0004,$AAA3;
  312. FUNCTION GetCompressionTime(src: PixMapHandle; srcRect: Rect;colorDepth: INTEGER;
  313.  cType: CodecType;codec: CompressorComponent;VAR spatialQuality: CodecQ;
  314.  VAR temporalQuality: CodecQ;VAR compressTime: LONGINT): OSErr;
  315.  INLINE $7000+$0005,$AAA3;
  316. FUNCTION CompressImage(src: PixMapHandle; srcRect: Rect;quality: CodecQ;
  317.  cType: CodecType;desc: ImageDescriptionHandle;data: Ptr): OSErr;
  318.  INLINE $7000+$0006,$AAA3;
  319. FUNCTION FCompressImage(src: PixMapHandle; srcRect: Rect;colorDepth: INTEGER;
  320.  quality: CodecQ;cType: CodecType;codec: CompressorComponent;clut: CTabHandle;
  321.  flags: CodecFlags;bufferSize: LONGINT;flushProc: FlushProcRecordPtr;progressProc: ProgressProcRecordPtr;
  322.  desc: ImageDescriptionHandle;data: Ptr): OSErr;
  323.  INLINE $7000+$0007,$AAA3;
  324. FUNCTION DecompressImage(data: Ptr;desc: ImageDescriptionHandle;dst: PixMapHandle;
  325.   srcRect: Rect; dstRect: Rect;mode: INTEGER;mask: RgnHandle): OSErr;
  326.  INLINE $7000+$0008,$AAA3;
  327. FUNCTION FDecompressImage(data: Ptr;desc: ImageDescriptionHandle;dst: PixMapHandle;
  328.   srcRect: Rect;matrix: MatrixRecordPtr;mode: INTEGER;mask: RgnHandle;
  329.  matte: PixMapHandle; matteRect: Rect;accuracy: CodecQ;codec: DecompressorComponent;
  330.  bufferSize: LONGINT;dataProc: DataProcRecordPtr;progressProc: ProgressProcRecordPtr): OSErr;
  331.  INLINE $7000+$0009,$AAA3;
  332. FUNCTION CompressSequenceBegin(VAR seqID: ImageSequence;src: PixMapHandle;
  333.  prev: PixMapHandle; srcRect: Rect; prevRect: Rect;colorDepth: INTEGER;
  334.  cType: CodecType;codec: CompressorComponent;spatialQuality: CodecQ;temporalQuality: CodecQ;
  335.  keyFrameRate: LONGINT;clut: CTabHandle;flags: CodecFlags;desc: ImageDescriptionHandle): OSErr;
  336.  INLINE $7000+$000A,$AAA3;
  337. FUNCTION CompressSequenceFrame(seqID: ImageSequence;src: PixMapHandle; srcRect: Rect;
  338.  flags: CodecFlags;data: Ptr;VAR dataSize: LONGINT;VAR similarity: Byte;
  339.  asyncCompletionProc: CompletionProcRecordPtr): OSErr;
  340.   INLINE $206F,$0004,$4250,$52AF,$0004,$7000+$000B,$AAA3;
  341. FUNCTION DecompressSequenceBegin(VAR seqID: ImageSequence;desc: ImageDescriptionHandle;
  342.  port: CGrafPtr;gdh: GDHandle; srcRect: Rect;matrix: MatrixRecordPtr;
  343.  mode: INTEGER;mask: RgnHandle;flags: CodecFlags;accuracy: CodecQ;codec: DecompressorComponent): OSErr;
  344.  INLINE $7000+$000D,$AAA3;
  345. FUNCTION DecompressSequenceFrame(seqID: ImageSequence;data: Ptr;inFlags: CodecFlags;
  346.  VAR outFlags: CodecFlags;asyncCompletionProc: CompletionProcRecordPtr): OSErr;
  347.  INLINE $7000+$000E,$AAA3;
  348. FUNCTION SetDSequenceMatrix(seqID: ImageSequence;matrix: MatrixRecordPtr): OSErr;
  349.  INLINE $7000+$0010,$AAA3;
  350. FUNCTION SetDSequenceMatte(seqID: ImageSequence;matte: PixMapHandle; matteRect: Rect): OSErr;
  351.  INLINE $7000+$0011,$AAA3;
  352. FUNCTION SetDSequenceMask(seqID: ImageSequence;mask: RgnHandle): OSErr;
  353.  INLINE $7000+$0012,$AAA3;
  354. FUNCTION SetDSequenceTransferMode(seqID: ImageSequence;mode: INTEGER; opColor: RGBColor): OSErr;
  355.  INLINE $7000+$0013,$AAA3;
  356. FUNCTION SetDSequenceDataProc(seqID: ImageSequence;dataProc: DataProcRecordPtr;
  357.  bufferSize: LONGINT): OSErr;
  358.  INLINE $7000+$0014,$AAA3;
  359. FUNCTION SetDSequenceAccuracy(seqID: ImageSequence;accuracy: CodecQ): OSErr;
  360.  INLINE $7000+$0034,$AAA3;
  361. FUNCTION SetDSequenceSrcRect(seqID: ImageSequence; srcRect: Rect): OSErr;
  362.  INLINE $7000+$0035,$AAA3;
  363. FUNCTION GetDSequenceImageBuffer(seqID: ImageSequence;VAR gworld: GWorldPtr): OSErr;
  364.  INLINE $7000+$0015,$AAA3;
  365. FUNCTION GetDSequenceScreenBuffer(seqID: ImageSequence;VAR gworld: GWorldPtr): OSErr;
  366.  INLINE $7000+$0016,$AAA3;
  367. FUNCTION SetCSequenceQuality(seqID: ImageSequence;spatialQuality: CodecQ;
  368.  temporalQuality: CodecQ): OSErr;
  369.  INLINE $7000+$0017,$AAA3;
  370. FUNCTION SetCSequencePrev(seqID: ImageSequence;prev: PixMapHandle; prevRect: Rect): OSErr;
  371.  INLINE $7000+$0018,$AAA3;
  372. FUNCTION SetCSequenceFlushProc(seqID: ImageSequence;flushProc: FlushProcRecordPtr;
  373.  bufferSize: LONGINT): OSErr;
  374.  INLINE $7000+$0033,$AAA3;
  375. FUNCTION SetCSequenceKeyFrameRate(seqID: ImageSequence;keyframerate: LONGINT): OSErr;
  376.  INLINE $7000+$0036,$AAA3;
  377. FUNCTION GetCSequenceKeyFrameRate(seqID: ImageSequence; VAR keyframerate: LONGINT): OSErr;
  378.  INLINE $203C,12,75,$AAA3;
  379. FUNCTION GetCSequencePrevBuffer(seqID: ImageSequence;VAR gworld: GWorldPtr): OSErr;
  380.  INLINE $7000+$0019,$AAA3;
  381. FUNCTION CDSequenceBusy(seqID: ImageSequence): OSErr;
  382.  INLINE $7000+$001A,$AAA3;
  383. FUNCTION CDSequenceEnd(seqID: ImageSequence): OSErr;
  384.  INLINE $7000+$001B,$AAA3;
  385. FUNCTION GetCompressedImageSize(desc: ImageDescriptionHandle;data: Ptr;
  386.  bufferSize: LONGINT;dataProc: DataProcRecordPtr;VAR dataSize: LONGINT): OSErr;
  387.  INLINE $7000+$001C,$AAA3;
  388. FUNCTION GetSimilarity(src: PixMapHandle; srcRect: Rect;desc: ImageDescriptionHandle;
  389.  data: Ptr;VAR similarity: Fixed): OSErr;
  390.  INLINE $7000+$001D,$AAA3;
  391. FUNCTION GetImageDescriptionCTable(desc: ImageDescriptionHandle;VAR ctable: CTabHandle): OSErr;
  392.  INLINE $7000+$001E,$AAA3;
  393. FUNCTION SetImageDescriptionCTable(desc: ImageDescriptionHandle;ctable: CTabHandle): OSErr;
  394.  INLINE $7000+$001F,$AAA3;
  395. FUNCTION GetImageDescriptionExtension(desc: ImageDescriptionHandle;VAR extension: Handle;
  396.  idType: LONGINT;index: LONGINT): OSErr;
  397.  INLINE $7000+$0020,$AAA3;
  398. FUNCTION SetImageDescriptionExtension(desc: ImageDescriptionHandle;extension: Handle;
  399.  idType: LONGINT): OSErr;
  400.  INLINE $7000+$0021,$AAA3;
  401. FUNCTION RemoveImageDescriptionExtension(desc: ImageDescriptionHandle; idType: LONGINT; index: LONGINT): OSErr;
  402.  INLINE $203C,12,$003A,$AAA3;
  403. FUNCTION CountImageDescriptionExtensionType(desc: ImageDescriptionHandle; idType: LONGINT; VAR count: LONGINT): OSErr;
  404.  INLINE $203C,12,$003B,$AAA3;
  405. FUNCTION GetNextImageDescriptionExtensionType(desc: ImageDescriptionHandle; VAR idType: LONGINT): OSErr;
  406.  INLINE $203C,8,$003C,$AAA3;
  407. FUNCTION FindCodec(cType: CodecType;specCodec: CodecComponent;VAR compressor: CompressorComponent;
  408.  VAR decompressor: DecompressorComponent): OSErr;
  409.  INLINE $7000+$0023,$AAA3;
  410. FUNCTION CompressPicture(srcPicture: PicHandle;dstPicture: PicHandle;quality: CodecQ;
  411.  cType: CodecType): OSErr;
  412.  INLINE $7000+$0024,$AAA3;
  413. FUNCTION FCompressPicture(srcPicture: PicHandle;dstPicture: PicHandle;colorDepth: INTEGER;
  414.  clut: CTabHandle;quality: CodecQ;doDither: INTEGER;compressAgain: INTEGER;
  415.  progressProc: ProgressProcRecordPtr;cType: CodecType;codec: CompressorComponent): OSErr;
  416.  INLINE $7000+$0025,$AAA3;
  417. FUNCTION CompressPictureFile(srcRefNum: INTEGER;dstRefNum: INTEGER;quality: CodecQ;
  418.  cType: CodecType): OSErr;
  419.  INLINE $7000+$0026,$AAA3;
  420. FUNCTION FCompressPictureFile(srcRefNum: INTEGER;dstRefNum: INTEGER;colorDepth: INTEGER;
  421.  clut: CTabHandle;quality: CodecQ;doDither: INTEGER;compressAgain: INTEGER;
  422.  progressProc: ProgressProcRecordPtr;cType: CodecType;codec: CompressorComponent): OSErr;
  423.  INLINE $7000+$0027,$AAA3;
  424. FUNCTION GetPictureFileHeader(refNum: INTEGER;VAR frame: Rect;VAR header: OpenCPicParams): OSErr;
  425.  INLINE $7000+$0028,$AAA3;
  426. FUNCTION DrawPictureFile(refNum: INTEGER; frame: Rect;progressProc: ProgressProcRecordPtr): OSErr;
  427.  INLINE $7000+$0029,$AAA3;
  428. FUNCTION DrawTrimmedPicture(srcPicture: PicHandle; frame: Rect;trimMask: RgnHandle;
  429.  doDither: INTEGER;progressProc: ProgressProcRecordPtr): OSErr;
  430.  INLINE $7000+$002E,$AAA3;
  431. FUNCTION DrawTrimmedPictureFile(srcRefnum: INTEGER; frame: Rect;trimMask: RgnHandle;
  432.  doDither: INTEGER;progressProc: ProgressProcRecordPtr): OSErr;
  433.  INLINE $7000+$002F,$AAA3;
  434. FUNCTION MakeThumbnailFromPicture(picture: PicHandle;colorDepth: INTEGER;
  435.  thumbnail: PicHandle;progressProc: ProgressProcRecordPtr): OSErr;
  436.  INLINE $7000+$002A,$AAA3;
  437. FUNCTION MakeThumbnailFromPictureFile(refNum: INTEGER;colorDepth: INTEGER;
  438.  thumbnail: PicHandle;progressProc: ProgressProcRecordPtr): OSErr;
  439.  INLINE $7000+$002B,$AAA3;
  440. FUNCTION MakeThumbnailFromPixMap(src: PixMapHandle; srcRect: Rect;colorDepth: INTEGER;
  441.  thumbnail: PicHandle;progressProc: ProgressProcRecordPtr): OSErr;
  442.  INLINE $7000+$002C,$AAA3;
  443. FUNCTION TrimImage(desc: ImageDescriptionHandle;inData: Ptr;inBufferSize: LONGINT;
  444.  dataProc: DataProcRecordPtr;outData: Ptr;outBufferSize: LONGINT;flushProc: FlushProcRecordPtr;
  445.   VAR trimRect: Rect;progressProc: ProgressProcRecordPtr): OSErr;
  446.  INLINE $7000+$002D,$AAA3;
  447. FUNCTION ConvertImage(srcDD: ImageDescriptionHandle;srcData: Ptr;colorDepth: INTEGER;
  448.  clut: CTabHandle;accuracy: CodecQ;quality: CodecQ;cType: CodecType;codec: CodecComponent;
  449.  dstDD: ImageDescriptionHandle;dstData: Ptr): OSErr;
  450.  INLINE $7000+$0030,$AAA3;
  451. FUNCTION StdPix( src: PixMapPtr;  srcRect :Rect; matrix : MatrixRecordPtr; mode : INTEGER;
  452.     mask: RgnHandle ;  matte: PixMapPtr;  matteRect: Rect; flags : INTEGER ) : OSErr;
  453. INLINE $7000+$000C,$AAA3;
  454.  
  455. FUNCTION GetCompressedPixMapInfo(pix: PixMapPtr;VAR desc: ImageDescriptionHandle;
  456.  VAR data: Ptr;VAR bufferSize: LONGINT;VAR dataProc: DataProcRecord;VAR progressProc: ProgressProcRecord): OSErr;
  457.  INLINE $7000+$0037,$AAA3;
  458. FUNCTION SetCompressedPixMapInfo(pix: PixMapPtr;desc: ImageDescriptionHandle;
  459.  data: Ptr;bufferSize: LONGINT;dataProc: DataProcRecordPtr;progressProc: ProgressProcRecordPtr): OSErr;
  460.  INLINE $7000+$0038,$AAA3;
  461.  
  462. PROCEDURE AlignScreenRect(VAR rp: Rect);
  463.  INLINE $203C,4,76,$AAA3;
  464. PROCEDURE AlignWindow(wp: WindowPtr; alignmentRect: Rect; front: Boolean);
  465.  INLINE $203C,10,77,$AAA3;
  466. PROCEDURE DragAlignedWindow(wp: WindowPtr; startPt: Point; boundsRect: Rect; alignmentRect: Rect);
  467.  INLINE $203C,16,78,$AAA3;
  468. FUNCTION DragAlignedGrayRgn(theRgn: RgnHandle; startPt: Point; boundsRect: Rect;
  469.  slopRect: Rect; axis: INTEGER; actionProc: ProcPtr; alignmentRect: RectPtr): LONGINT;
  470.  INLINE $203C,26,79,$AAA3;
  471.  
  472. FUNCTION SetCSequenceDataRateParams(seqID: ImageSequence; params: DataRateParamsPtr): OSErr;
  473.  INLINE $203C,8,80,$AAA3;
  474. FUNCTION SetCSequenceFrameNumber(seqID: ImageSequence; frameNumber: LONGINT): OSErr;
  475.  INLINE $203C,8,81,$AAA3;
  476. FUNCTION NewImageGWorld(VAR gworld: GWorldPtr; idh: ImageDescriptionHandle; flags GWorldFlags): OSErr;
  477.  INLINE $203C,12,82,$AAA3;
  478. FUNCTION GetCSequenceDataRateParams(seqID: ImageSequence; params: DataRateParamsPtr): OSErr;
  479.  INLINE $203C,8,83,$AAA3;
  480. FUNCTION GetCSequenceFrameNumber(seqID: ImageSequence; VAR frameNumber: LONGINT): OSErr;
  481.  INLINE $203C,8,84,$AAA3;
  482. FUNCTION GetBestDeviceRect(VAR gdh: GDHandle; rp: RectPtr): OSErr;
  483.  INLINE $203C,8,85,$AAA3;
  484.  
  485.  
  486. CONST
  487.  identityMatrixType            = $00;                         { result if matrix is identity }
  488.  translateMatrixType        = $01;                         { result if matrix translates }
  489.  scaleMatrixType            = $02;                         { result if matrix scales }
  490.  scaleTranslateMatrixType    = $03;                         { result if matrix scales and translates }
  491.  linearMatrixType            = $04;                         { result if matrix is general 2 x 2 }
  492.  linearTranslateMatrixType    = $05;                         { result if matrix is general 2 x 2 and translates }
  493.  perspectiveMatrixType        = $06;                         { result if matrix is general 3 x 3 }
  494.  
  495.  
  496. FUNCTION GetMatrixType( m: MatrixRecord): INTEGER;
  497.  INLINE $7014,$ABC2;
  498. PROCEDURE CopyMatrix(m1: MatrixRecord;VAR m2: MatrixRecord);
  499.  INLINE $7020,$ABC2;
  500. FUNCTION EqualMatrix(m1: MatrixRecord; m2: MatrixRecord): BOOLEAN;
  501.  INLINE $7021,$ABC2;
  502. PROCEDURE SetIdentityMatrix(VAR matrix: MatrixRecord);
  503.  INLINE $7015,$ABC2;
  504. PROCEDURE TranslateMatrix(VAR m: MatrixRecord;deltaH: Fixed;deltaV: Fixed);
  505.  INLINE $7019,$ABC2;
  506. PROCEDURE RotateMatrix(VAR m: MatrixRecord;degrees: Fixed;aboutX: Fixed;
  507.  aboutY: Fixed);
  508.  INLINE $7016,$ABC2;
  509. PROCEDURE ScaleMatrix(VAR m: MatrixRecord;scaleX: Fixed;scaleY: Fixed;aboutX: Fixed;
  510.  aboutY: Fixed);
  511.  INLINE $7017,$ABC2;
  512. PROCEDURE SkewMatrix(VAR m: MatrixRecord;skewX: Fixed;skewY: Fixed;aboutX: Fixed;
  513.  aboutY: Fixed);
  514.  INLINE $7018,$ABC2;
  515. FUNCTION TransformFixedPoints( m: MatrixRecord;VAR fpt: FixedPoint;count: LONGINT): OSErr;
  516.  INLINE $7022,$ABC2;
  517. FUNCTION TransformPoints( mp: MatrixRecord;VAR pt1: Point;count: LONGINT): OSErr;
  518.  INLINE $7023,$ABC2;
  519. FUNCTION TransformFixedRect( m: MatrixRecord;VAR fr: FixedRect;VAR fpp: FixedPoint): BOOLEAN;
  520.  INLINE $7024,$ABC2;
  521. FUNCTION TransformRect( m: MatrixRecord;VAR r: Rect;VAR fpp: FixedPoint): BOOLEAN;
  522.  INLINE $7025,$ABC2;
  523. FUNCTION TransformRgn( mp: MatrixRecord;r: RgnHandle): OSErr;
  524.  INLINE $7000+$0039,$AAA3;
  525. FUNCTION InverseMatrix(m: MatrixRecord; VAR im: MatrixRecord): BOOLEAN;
  526.  INLINE $701C,$ABC2;
  527. PROCEDURE ConcatMatrix(a: MatrixRecord;VAR b: MatrixRecord);
  528.  INLINE $701B,$ABC2;
  529. PROCEDURE RectMatrix(VAR matrix: MatrixRecord; srcRect: Rect; dstRect: Rect);
  530.  INLINE $701E,$ABC2;
  531. PROCEDURE MapMatrix(VAR matrix: MatrixRecord; fromRect: Rect; toRect: Rect);
  532.  INLINE $701D,$ABC2;
  533.  
  534. {   Standard Preview  }
  535.  
  536. PROCEDURE SFGetFilePreview(where: Point;
  537.                     prompt: Str255;
  538.                     fileFilter: FileFilterProcPtr;
  539.                     numTypes: INTEGER;
  540.                     typeList: SFTypeList;
  541.                     dlgHook: DlgHookProcPtr;
  542.                     VAR reply: SFReply);
  543.  INLINE $303C,65,$AAA3;
  544.  
  545. PROCEDURE SFPGetFilePreview(where: Point;
  546.                      prompt: Str255;
  547.                      fileFilter: FileFilterProcPtr;
  548.                      numTypes: INTEGER;
  549.                      typeList: SFTypeList;
  550.                      dlgHook: DlgHookProcPtr;
  551.                      VAR reply: SFReply;
  552.                      dlgID: INTEGER;
  553.                      filterProc: ModalFilterProcPtr);
  554.  INLINE $303C,66,$AAA3;
  555.  
  556. PROCEDURE StandardGetFilePreview(fileFilter: FileFilterProcPtr;
  557.                           numTypes: INTEGER;
  558.                           typeList: SFTypeList;
  559.                           VAR reply: StandardFileReply);
  560.  INLINE $303C,67,$AAA3;
  561.  
  562. PROCEDURE CustomGetFilePreview(fileFilter: FileFilterYDProcPtr;
  563.                         numTypes: INTEGER;
  564.                         typeList: SFTypeList;
  565.                         VAR reply: StandardFileReply;
  566.                         dlgID: INTEGER;
  567.                         where: Point;
  568.                         dlgHook: DlgHookYDProcPtr;
  569.                         filterProc: ModalFilterYDProcPtr;
  570.                         activeList: Ptr;
  571.                         activateProc: ActivateYDProcPtr;
  572.                         yourDataPtr: UNIV Ptr);
  573.  INLINE $303C,68,$AAA3;
  574.  
  575. FUNCTION MakeFilePreview(resRefNum: INTEGER;  progress: ProgressProcRecordPtr): OSErr;
  576.  INLINE $303C,69,$AAA3;
  577.  
  578. FUNCTION AddFilePreview(resRefNum: INTEGER; previewType: OSType; previewData: Handle): OSErr;
  579.  INLINE $303C,70,$AAA3;
  580.  
  581. CONST
  582.     sfpItemPreviewAreaUser = 11;
  583.     sfpItemPreviewStaticText = 12;
  584.     sfpItemPreviewDividerUser = 13;
  585.     sfpItemCreatePreviewButton = 14;
  586.     sfpItemShowPreviewButton = 15;
  587.  
  588. TYPE
  589.  
  590. PreviewResourcePtr = ^PreviewResourceRecord;
  591. PreviewResourceHandle = ^PreviewResourcePtr;
  592. PreviewResourceRecord = RECORD
  593.     modDate : LONGINT;
  594.     version : INTEGER;
  595.     resType : OSType;
  596.     resID : INTEGER;
  597. END;
  598.  
  599. {$ENDC} { UsingImageCompression }
  600.  
  601. {$IFC NOT UsingIncludes}
  602.  END.
  603. {$ENDC}
  604.